﻿using Abp.Application.Services;
using Abp.Application.Services.Dto;
using Abp.Organizations;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Partner.Surround.Organizations.Dto;

namespace Partner.Surround.Organizations
{
    public interface IOrganizationUnitAppService : IApplicationService
    {
        /// <summary>
        /// 获取组织机构（树形结构数据）
        /// </summary>
        /// <returns></returns>
        Task<ListResultDto<OrganizationUnitListDto>> GetAllOrganizationUnitTree();

        /// <summary>
        /// 获取子级组织机构及每个组织机构下的用户数量（树形结构数据）
        /// </summary>
        /// <param name="input">父级组织机构</param>
        /// <returns></returns>
        Task<PagedResultDto<OrganizationUnitListDto>> GetPagedOrganizationUnit(GetPagedOrganizationUnitInput input);

        /// <summary>
        /// 获取组织机构编辑
        /// </summary>
        /// <returns></returns>
        Task<GetOrganizationUnitForEditOutput> GetOrganizationUnitForEdit(NullableIdDto<long> input);

        /// <summary>
        /// 创建或更新组织机构
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task CreateOrUpdateOrganizationUnit(CreateOrUpdateOrganizationUnitInput input);

        /// <summary>
        /// 删除组织机构
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task DeleteOrganizationUnit(List<EntityDto<long>> inputs);

        /// <summary>
        /// 将目标组织机构移入到指定组织机构
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<OrganizationUnitListDto> MoveOrganizationUnit(MoveOrganizationUnitInput input);
    }
}
